#ifndef SystemTick_H
#define SystemTick_H

//#include "mydefine.h"
#include "libconfig.h"
#include "stm32f1xx.h"
#include "system.h"

#ifdef SystemTick_GLOBALS
	#define SystemTick_EXT
#else
	#define SystemTick_EXT extern
#endif

SystemTick_EXT s32 bb_n;
SystemTick_EXT s32 bb_t;
#define BB(x)       \
	do              \
	{               \
		bb_n = (x); \
	} while (0)
#define BBT(mS)                             \
	do                                      \
	{                                       \
		bb_n = -1;                          \
		bb_t = MAX((((mS) + 50) / 100), 1); \
	} while (0)
#define bbt(mS)  \
	do           \
	{            \
		BBT(mS); \
	} while (0)
#define bb(x)  \
	do         \
	{          \
		BB(x); \
	} while (0)
#define bb_get() (bb_n + 0)

//void SystemTick_int(void);//HAL_IncTick()

void Tick_Handler(void);   //
void SystemTickExec(void); //
void UserProgram(void);	   //
void SecProgram(void);

void SystemTick(void);
#endif

